#include "stdafx.h"

#include "GameWinMain.h"
#include "GameEngine.h"
#include "../../Game.h"

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance,
				   PSTR cmdLine, int showCmd)
{
	// Enable run-time memory leak check for debug builds.
	#if defined(DEBUG) | defined(_DEBUG)
		_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
		//_CrtSetBreakAlloc(4641);
	#endif

	//Create Engine
	GameEngine *EnginePtr = GameEngine::GetSingleton();

	//Create Game
	Game *GamePtr = Game::GetSingleton();

	//set game pointer in Engine
	EnginePtr->SetGame(GamePtr);

	//Run the game
	EnginePtr->Run(hInstance, showCmd);

	//destroy objects
	delete GamePtr;
	delete EnginePtr;

	return NULL;

}